package com.lin.missyou.model;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

/**
 * @author gcq
 * @Create 2021-10-24
 */
@Entity
@Setter
@Getter
@Where(clause = "delete_time is null")
public class Theme extends BaseEntity {

    @Id
    private Long id;
    private String title;
    private String description;
    private String name;
    /**
     * 指定主题应用什么模板 cms中动态编辑数据
     */
    private String tplName;
    private String entranceImg;
    private String extend;
    private String internalTopImg;
    private String titleImg;
    private Boolean online;

    /**
     * 关联第三张表
     * theme_spu
     *
     */
    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "theme_spu", joinColumns = @JoinColumn(name = "theme_id"),
            inverseJoinColumns = @JoinColumn(name = "spu_id"))
    private List<Spu> spuList;
}